package com.tuananh.radnom.model.netpoller;

import java.util.ArrayList;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "poll-serv")
public class PollingService {
	String netService;
	ArrayList<PollMapEntry> entries;
	
	ArrayList<PollPackage> packages;
	long defaultInterval = 10000;

	public PollingService() {

	}

	public PollingService(String netService, ArrayList<PollMapEntry> entries,
			long defaultInterval) {
		this.netService = netService;
		this.entries = entries;
		this.defaultInterval = defaultInterval;
	}
	public PollingService(PollScheduleInfo pollInfo){
		this.netService = pollInfo.getNetServiceName();
		this.entries = new ArrayList<PollMapEntry>();
	//	this.entries.add(new PollMapEntry(pollInfo.getNetIntName(), pollInfo.getInterval()));
	}
	@XmlAttribute(name = "default-interval")
	public long getDefaultInterval() {
		return defaultInterval;
	}

	public void setDefaultInterval(long defaultInterval) {
		this.defaultInterval = defaultInterval;
	}

	@XmlAttribute
	public String getNetService() {
		return netService;
	}

	public void setNetService(String netService) {
		this.netService = netService;
	}

	public ArrayList<PollMapEntry> getMap() {
		return entries;
	}

	public void setMap(ArrayList<PollMapEntry> entries) {
		this.entries = entries;
	}
}
